<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品有戏商家合作平台</title>
    <script src="__JS__/jquery.js"></script>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
</head>
<body>
{include file="base/header" /}
<table class="layui-table" style="text-align: center">
    <thead>
    <tr>
        <td>商品名称</td>
        <td>单价(元)</td>
        <td>购买数(个)</td>
        <td>总价(元)</td>
        <td>支付凭证</td>
        <td>描述</td>
        <td>运单号</td>
        <td>快递公司</td>
        <td>状态</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
    <tr id="{$val.id}">
        <td>{$val.pname}</td>
        <td>{$val.purchaseprice}</td>
        <td>{$val.number}</td>
        <td>{$val.total}</td>
        <td><img src="__ROOT__\{$val.images}" height="50" width="50"/></td>
        <td onclick="describe({$val.id})" >{$val.describe|substr=###,0,9}...<a>详情</a></td>
        <td>{$val.oddnumber}</td>
        <td>{$val.express}</td>
        <td style="color: red">{if $val.status == 2 } 待处理 {elseif $val.status == 3/} 邮寄中 {elseif $val.status == 4/}货已到{elseif $val.status == 5 /}已完成 {/if}</td>
        <td>
            <button type="button" onclick="orderdetail({$val.id})" class="btn btn-info btn-xs">订单详情</button>
            {if $val.status == 2}
                <button type="button" onclick="delivergoods({$val.id})" class="btn btn-warning btn-xs">发货</button>
            {else/}
                <button type="button" disabled class="btn btn-warning btn-xs">发货</button>
            {/if}
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>
</body>
<script>
    //描述详情
    function describe(id) {
        layer.open({
            type:2,
            title:"描述",
            anim:2,
            area: ['500px', '400px'],
            content:"{:url('business/index/describe')}?id="+id
        });
    }
    //发货
    function delivergoods(id) {
        layer.open({
            type:2,
            title:"添加物流信息",
            anim:2,
            area: ['500px', '400px'],
            content:"{:url('business/index/express')}?id="+id
        });
    }
    //订单详情
    function orderdetail(id) {
        layer.open({
            type:2,
            title:"描述",
            anim:2,
            area: ['700px', '600px'],
            content:"{:url('business/index/orderdetail')}?id="+id
        });
    }
</script>
</html>